package com.qf.agro.common.sys;


/**
 * @company：千锋教育
 * @author：zhy
 * @date：2023/6/30
 * 用于实现，把当前用户和线程绑定，以及解绑的工具类
 */


import com.qf.agro.pojo.sys.SysUser;

/**
 * 存入线程局部变量
 */
public class SysUserHolder {

    private static ThreadLocal<SysUser> threadLocal = new ThreadLocal<SysUser>();

    public static void set(SysUser sysUser){
        threadLocal.set(sysUser);
    }


    public static  SysUser  get(){
        return threadLocal.get();
    }


    public static void remove(){
        threadLocal.remove();
    }
}
